﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CallMVC.Models.LoginModel>" %>



<asp:Content ID="calculationTitle" ContentPlaceHolderID="Title1"  runat="server">
    <%
      DBManager.Customer cust = ViewBag.Customer;
    %>
        <a href="<%: Url.Action("Calculation", "Home", new { customerId = cust.CustomerID })%>"><img src="/CalcApp/images/<%= cust.LogoLink %>"/></a>

        <div id="right" style="position:absolute;right:0">
            <a href="<%: Url.Action("infoPage", "Home", new { customerId = cust.CustomerID })%>" data-icon="bars"><img src="http://www.clker.com/cliparts/w/x/4/3/m/V/blue-information-glossy-button-hi.png" width="20" height="20"/></a>
        </div>
</asp:Content>

<asp:Content ID="calculationContent" ContentPlaceHolderID="MainContent" runat="server">
    
    <% using (Html.BeginForm()) {

          // HyperLink1.NavigateUrl = "/Image/index.php";
                      
           %>
     

            <ul data-role="listview" data-inset="true">

            <% 
           DBManager.Customer cust = ViewBag.Customer;
           if (cust.TextSelectCalculation == null)
           {
           
                 %>

            <li data-role="listview"><label>Select Calculation</label></li>
            <% }
           else
           { %>
               <li data-role="listview"><label><%=cust.TextSelectCalculation%></label></li>
               <% } %>
            </ul>
            <%
           System.Collections.Generic.List<DBManager.Calculation> calList = this.ViewBag.Calculations;

           string data_filter = "true";
           string data_filter_text = "Filter items";

           if (cust.TextFilterItems != null)
               data_filter_text = cust.TextFilterItems;

           if (calList.Count <= 10)
           {
               data_filter = "false";
           }             
                 %>
            <ul data-role="listview" data-filter="<%=data_filter %>" data-filter-placeholder="<%=data_filter_text %>" >
            <%
           string pageCalc = "CalcInput";
           
           if (User.Identity.IsAuthenticated)
           {
               pageCalc = "SavedCalc";
           }
           
           

           for (int i = 0; i < calList.Count; ++i )
           {
                %>
                <li>
                <%:       
                Html.ActionLink(calList[i].CaculationName, pageCalc, new { calculationId = calList[i].CalculationID })
                %>
                </li>
                <% 
           }
                    %>
            </ul>
        
    
    <br />

        <% } %>
    
</asp:Content>